package com.hds.modules.app.dao;

import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.hds.modules.app.entity.UserMessage;
import org.apache.ibatis.annotations.Mapper;

@Mapper
public interface UserMessageDao extends BaseMapper<UserMessage> {
	/**
	 *
	 * @Override
	 * 	public UserMessage findMaxOne(String uid) {
	 * 		String selectHql = "from UserMessage where messageTime in(select max(messageTime) from UserMessage where type=0 and uid=?)";
	 * 		List<UserMessage> glist = find(selectHql, new Object[]{uid});
	 * 		UserMessage um = null;
	 * 		if (glist!=null && glist.size()>0)
	 * 			um = glist.get(0);
	 * 		return um;
	 * 	}
	 *
	 * 	@Override
	 * 	public UserMessage findMaxOneMessageAndMajorNoutNull(String uid) {
	 * 		String selectHql = "from UserMessage where uid=? and type=0 and major!='' order by messageTime desc";
	 * 		List<UserMessage> glist = find(selectHql, new Object[]{uid});
	 * 		UserMessage um = null;
	 * 		if (glist!=null && glist.size()>0)
	 * 			um = glist.get(0);
	 * 		return um;
	 * 	}
	 * @param userId
	 * @return
	 */


	public UserMessage findMaxOne(Integer userId);

	public UserMessage findMaxOneMessageAndMajorNoutNull(Integer userId);
}
